import { UILayer } from "../../manager/UILayer";
import { PetDrugItemInfo } from "../avatar/PetDrugItemInfo";
import { ModuleType } from "../common/ModuleType";
import { GuideTipsManager } from "../../manager/GuideTipsManager";
import { Language } from "../../../../extend/language/Language";
import { HighlightManager } from "../../manager/HighlightManager";
import { ItemData } from "../../resource/info/ItemData";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { ColorConfig } from "../../resource/ColorConfig";
import { EffectManager } from "../../manager/EffectManager";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { FishIconView } from "../fishing/FishIconView";
import { ToolTipsManager } from "../../../../com/mui/manager/ToolTipsManager";
import { SoundManager } from "../../../common/sound/SoundManager";
import { SoundTypeConst } from "../../../common/sound/SoundTypeConst";
import { SPetInfo } from "../../../../Message/Game/SPetInfo";
import { ParamsConst } from "../../../common/global/ParamsConst";
import { Cache } from "../../cache/Cache";
import { FavoriteView } from "./FavoriteView";
import { Global } from "../../../../com/gengine/global/Global";
import { TweenMax } from "../../../../com/greensock/TweenMax";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { VipCard } from "../vip/VipCard";
import { Shortcuts } from "../shortcuts/Shortcuts";
import { GameController } from "../../mvc/GameController";
import { UiHintIconView } from "../uiIconBtn/UiHintIconView";
import { UiActiveHintIconView } from "../uiIconBtn/UiActiveHintIconView";
import { LayerManager } from "../../manager/LayerManager";
import { UiFlyDispalyObjectUtil } from "../uiIconBtn/UiFlyDispalyObjectUtil";
import { RoashProgressBar } from "../fishing/roastFish/RoashProgressBar";
import { SpecialSkillPanel } from "../bossField/SpecialSkillPanel";
import { ILayOut } from "../../../../modules/interfaces/ILayOut";
import { GuideArrowManager } from "../../manager/GuideArrowManager";
import { LaterUtil } from "../../../common/LaterUtil";
import { DisplayUtil } from "../../../common/DisplayUtil";
import { ObjectUtils } from "../../../../com/gengine/utils/ObjectUtils";
import { GuibintongdaoHintBtn } from "./GuibintongdaoHintBtn";
import { LevelSealInfo } from "./info/LevelSealInfo";
import { NavSprite } from "./NavSprite";
import { SmallMap } from "./SmallMap";
import { TeamAvatarSprite } from "./TeamAvatarSprite";
import { ProxyType } from "../../../common/global/ProxyType";
import { ObjCreate } from "../common/ObjCreate";
import { ResFileConst } from "../../resource/ResFileConst";
import { MsgManager } from "../../manager/MsgManager";
import { MsgTipsBtn } from "../msgtips/MsgTipsBtn";
import { PetDrugBagSprite } from "./PetDrugBagSprite";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { Quint } from "../../../../com/greensock/easing/Quint";
import { GButton } from "../../../../com/mui/controls/GButton";
import { MeidaCardWindow } from "./MeidaCardWindow";
import { TurnedHintIcon } from "../common/hintIcon/TurnedHintIcon";
import { WalkthroughIcon } from "../walkthrough/WalkthroughIcon";
import { PetMenuPanel } from "./PetMenuPanel";
import { XpSkillTipPanel } from "./XpSkillTipPanel";
import { SEntityInfo } from "../../../../Message/BroadCast/SEntityInfo";
import { RoleAvatar } from "../avatar/RoleAvatar";
import { EPetStatus } from "../../../../Message/Game/EPetStatus";
import { PetAvatar } from "../avatar/PetAvatar";
import { EntityInfo } from "../../scene/player/info/EntityInfo";
import { AimAvatar } from "../avatar/AimAvatar";
import { MonsterAvatar } from "../avatar/MonsterAvatar";
import { NPCAvatar } from "../avatar/NPCAvatar";
import { ExpBar } from "./ExpBar";
import { SkillStateConfig } from "../../resource/SkillStateConfig";
import { TState } from "../../../../Message/Db/Tables/TState";
import { AStarPoint } from "../../scene/map/AStarPoint";
import { RolePlayer } from "../../scene/player/entity/RolePlayer";
import { DailyAwardPanel } from "../award/DailyAwardPanel";
import { LevelAwardPanel } from "../award/LevelAwardPanel";
import { TweenLite } from "../../../../com/greensock/TweenLite";
import { SVIPInfo } from "../../../../Message/Game/SVIPInfo";
import { GLabel } from "../../../../com/mui/controls/GLabel";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
import { Players } from "../../../../ModuleType/Players";
import { Pack } from "../../../../ModuleType/Pack";
import { Skills } from "../../../../ModuleType/Skills";
import { Pets } from "../../../../ModuleType/Pets";
import { Guild } from "../../../../ModuleType/Guild";
import { Mounts } from "../../../../ModuleType/Mounts";
import { Activity } from "../../../../ModuleType/Activity";
import { SysSet } from "../../../../ModuleType/SysSet";
import { Shops } from "../../../../ModuleType/Shops";
import { Pay } from "../../../../ModuleType/Pay";
import { ExploreShop } from "../../../../ModuleType/ExploreShop";
import { Fairyland } from "../../../../ModuleType/Fairyland";
import { _mediaCardY } from "../../../../this/_mediaCardY";
import { _nvPosY } from "../../../../this/_nvPosY";
import { Daily } from "../../../../ModuleType/Daily";
type int = number;
//class GameUI
    
    export  class GameUI extends UILayer
    {
        constructor()
        {
            super();
            this._teamAvatar = [];
            this._petdragItemInfo = new PetDrugItemInfo();
            this.init();
            tabChildren = false;
            return;
        }

        public onGameUINavBarSetButtonVisible(arg1: string, arg2: Boolean): void
        {
            this._navSprite.setButtonVisible(arg1, arg2);
            return;
        }

        public openPetModuleSkillRefresh(): void
        {
            var loc2=null;
            var loc1=this._navbar.getChildByName(ModuleType.Pets) as Object /* flash.display.SimpleButton */;
            if (loc1) 
            {
                loc2 = GuideTipsManager.getGuideTips(GuideTipsManager.Dir_BL, Language.getString(21050));
                loc2.x = this._navbar.x + loc1.x + loc1.width / 2 - 10;
                loc2.y = this._navbar.y + loc1.y;
                loc2.baseX = loc1.x + loc1.width / 2;
                loc2.baseY = loc1.y;
                loc2.baseLayer = this.navbar;
                this.addChild(loc2);
                HighlightManager.instance.glowEffectButton(loc1, true);
            }
            return;
        }

        public openPackModuleUseFragment(arg1: ItemData): void
        {
            var loc2=null;
            var loc1=this._navbar.getChildByName(ModuleType.Pack) as Object /* flash.display.SimpleButton */;
            if (loc1) 
            {
                loc2 = GuideTipsManager.getGuideTips(GuideTipsManager.Dir_BL, Language.getStringByParam(26002, HTMLUtil.addColor(arg1.itemAmount + "", "#00ff00"), HTMLUtil.addColor(arg1.name, ColorConfig.instance.getItemColorString(arg1.color))));
                EffectManager.glowFilterReg(loc2, [FilterConst.guideTipsFilter]);
                loc2.x = this._navbar.x + loc1.x + loc1.width / 2 - 10;
                loc2.y = this._navbar.y + loc1.y;
                loc2.baseX = loc1.x + loc1.width / 2;
                loc2.baseY = loc1.y;
                loc2.baseLayer = this.navbar;
                this.addChild(loc2);
                HighlightManager.instance.glowEffectButton(loc1, true);
            }
            return;
        }

        public openRoleModuleUseFragment(): void
        {
            var loc2=null;
            var loc1=this._navbar.getChildByName(ModuleType.Players) as Object /* flash.display.SimpleButton */;
            if (loc1) 
            {
                loc2 = GuideTipsManager.getGuideTips(GuideTipsManager.Dir_BR, Language.getString(26001));
                EffectManager.glowFilterReg(loc2, [FilterConst.guideTipsFilter]);
                loc2.x = this._navbar.x + loc1.x + loc1.width / 2 - 10;
                loc2.y = this._navbar.y + loc1.y;
                loc2.baseX = loc1.x + loc1.width / 2;
                loc2.baseY = loc1.y;
                loc2.baseLayer = this.navbar;
                this.addChild(loc2);
                HighlightManager.instance.glowEffectButton(loc1, true);
            }
            return;
        }

        public showLevelGetSkill(): void
        {
            if (!this._skillLevelGet) 
            {
                this._skillLevelGet = FishIconView.instace;
            }
            if (this._skillLevelGet.isHide) 
            {
                this._skillLevelGet.show();
            }
            this._skillLevelGet.stageResize(this._smallMap.x - 280, 150);
            return;
        }

        public onGuideSkillMarry(): void
        {
            var loc2=null;
            var loc1=this._navbar.getChildByName(ModuleType.Skills) as Object /* flash.display.SimpleButton */;
            if (loc1) 
            {
                loc2 = GuideTipsManager.getGuideTips(GuideTipsManager.Dir_BR, Language.getString(20375));
                loc2.x = this._navbar.x + loc1.x + loc1.width / 2 - 10;
                loc2.y = this._navbar.y + loc1.y;
                loc2.baseX = loc1.x + loc1.width / 2;
                loc2.baseY = loc1.y;
                loc2.baseLayer = this.navbar;
                this.addChild(loc2);
                HighlightManager.instance.glowEffectButton(loc1, true);
            }
            return;
        }

        /* internal  */regBtnToolTip(): void
        {
            var loc4=null;
            var loc5=null;
            var loc6=null;
            var loc1=[{"name": Players, "value": Language.getStringByParam(51004, "C")}, {"name": Pack, "value": Language.getStringByParam(51005, "B")}, {"name": Skills, "value": Language.getStringByParam(51010, "V")}, {"name": Pets, "value": Language.getStringByParam(51006, "W")}, {"name": Guild, "value": Language.getStringByParam(51008, "G")}, {"name": Mounts, "value": Language.getStringByParam(51116, "J")}, {"name": Activity, "value": Language.getStringByParam(51009, "O")}, {"name": SysSet, "value": Language.getString(51016)}, {"name": Shops, "value": Language.getStringByParam(51017, "S")}, {"name": Pay, "value": Language.getString(51018)}, {"name": ExploreShop, "value": Language.getString(51011)}, {"name": Fairyland, "value": Language.getString(51011)}];
            var loc2=0;
            while (loc2 < loc1.length) 
            {
                loc6 = (loc4 = loc1[loc2]).name as string;
                if (loc5 = this._navbar.getChildByName(loc6) as Object /* flash.display.SimpleButton */) 
                {
                    loc5.addEventListener(flash.events.MouseEvent.MOUSE_OVER, this.onBtnMouseOver);
                    loc5.addEventListener(flash.events.MouseEvent.MOUSE_OUT, this.onBtnMouseOut);
                    if (loc6 == ModuleType.SysSet || loc6 == ModuleType.Pay || loc6 == ModuleType.ExploreShop) 
                    {
                        ToolTipsManager.register(loc5, null, HTMLUtil.addColor(loc4.value as string, "#FFFFFF"));
                    }
                }
                ++loc2;
            }
            var loc3=this._navbar.getChildByName("barUp") as Object /* flash.display.SimpleButton */;
            return;
        }

        /* internal  */onBtnMouseOver(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=arg1.target as Object /* flash.display.DisplayObject */;
            loc1.filters = [FilterConst.uiBtnFilter];
            return;
        }

        /* internal  */playSound(arg1: Object /* flash.display.SimpleButton */): void
        {
            var loc1=arg1.name;
            switch (loc1) 
            {
                case "players":
                {
                    SoundManager.instance.soundPlay(SoundTypeConst.piano31);
                    break;
                }
                case "pack":
                {
                    SoundManager.instance.soundPlay(SoundTypeConst.piano32);
                    break;
                }
                case "pets":
                {
                    SoundManager.instance.soundPlay(SoundTypeConst.piano33);
                    break;
                }
                case "mounts":
                {
                    SoundManager.instance.soundPlay(SoundTypeConst.piano34);
                    break;
                }
                case "guild":
                {
                    SoundManager.instance.soundPlay(SoundTypeConst.piano35);
                    break;
                }
                case "activity":
                {
                    SoundManager.instance.soundPlay(SoundTypeConst.piano36);
                    break;
                }
                case "skills":
                {
                    SoundManager.instance.soundPlay(SoundTypeConst.piano37);
                    break;
                }
                case "exploreShop":
                {
                    SoundManager.instance.soundPlay(SoundTypeConst.piano21);
                    break;
                }
                case ModuleType.Fairyland:
                {
                    SoundManager.instance.soundPlay(SoundTypeConst.piano21);
                    break;
                }
            }
            return;
        }

        /* internal  */onBtnMouseOut(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=arg1.target as Object /* flash.display.SimpleButton */;
            loc1.filters = [];
            return;
        }

        public getPetAvatarSPetInfo(): SPetInfo
        {
            var loc1=null;
            if (this._petAvatar) 
            {
                loc1 = this._petAvatar.petInfo;
            }
            return loc1;
        }

        public showOrHideFavorite(): void
        {
            var loc2=0;
            var loc3=0;
            if (!ParamsConst.instance.isShowFavorites) 
            {
                return;
            }
            var loc1=Cache.instance.role.isAddedFavorite;
            if (loc1) 
            {
                if (this._favoriteView && this.contains(this._favoriteView)) 
                {
                    this.removeChild(this._favoriteView);
                }
            }
            else if (Cache.instance.role.entityInfo.level >= 18) 
            {
                if (this._favoriteView == null) 
                {
                    this._favoriteView = new FavoriteView();
                    this._favoriteView.x = (Global.stage.stageWidth - this._favoriteView.width) / 2;
                    this._favoriteView.y = (Global.stage.stageHeight - this._favoriteView.height) / 2;
                }
                if (!this.contains(this._favoriteView)) 
                {
                    this.addChild(this._favoriteView);
                    EffectManager.glowFilterReg(this._favoriteView, [FilterConst.uiBtnFilter]);
                    loc2 = Global.stage.stageWidth - this._favoriteView.width + 30;
                    loc3 = this._smallMap.y + 450;
                    TweenMax.to(this._favoriteView, 2, {"x": loc2, "y": loc3});
                }
            }
            return;
        }

        /* internal  */onSmeltButtonClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.SmeltSmeltButtonClick));
            return;
        }

        /* internal  */onQuestionBtnClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.QuestionBtnClick));
            return;
        }

        public showVipCard(arg1: Object /* flash.geom.Point */, arg2: Object /* flash.display.BitmapData */, arg3: ItemData): void
        {
            if (!this._vipCard) 
            {
                this._vipCard = new VipCard();
            }
            this._vipCard.show();
            this.onFlyVipCardEnd(new Object /* flash.display.Bitmap */(arg2));
            return;
        }

        /* internal  */onFlyVipCardEnd(arg1: Object /* flash.display.Bitmap */): void
        {
            if (this._vipCard) 
            {
                this._vipCard.updateData(arg1);
            }
            return;
        }

        public hideVipCard(): void
        {
            if (this._vipCard) 
            {
                this._vipCard.clean();
                this._vipCard.hide();
            }
            return;
        }

        public onVipTestCardRes(): void
        {
            if (Cache.instance.vip.vipTestCard != null) 
            {
                if (!this._vipCard) 
                {
                    this._vipCard = new VipCard();
                }
                this._vipCard.show();
                this._vipCard.updateInfo(Cache.instance.vip.vipTestCard);
            }
            return;
        }

        public get navbar(): Object /* flash.display.MovieClip */
        {
            return this._navbar;
        }

        public addShortcuts(arg1: Object /* flash.display.DisplayObject */): void
        {
            this._shortcuts = arg1 as Shortcuts;
            this.addChild(this._shortcuts);
            return;
        }

        public /* override */ resize(arg1: number, arg2: number): void
        {
            var loc1=arg1;
            var loc2=arg2;
            if (loc1 < 1000) 
            {
                this._smallMap.x = loc1;
                this._msgTipBtn.x = 1000 - this._msgTipBtn.width;
            }
            else 
            {
                this._smallMap.x = loc1;
                this._msgTipBtn.x = loc1 - this._msgTipBtn.width;
            }
            var loc3=GameController.chat.view as Object /* flash.display.DisplayObject */;
            if (GameUI.ChatWidth + GameUI.NavWidth <= loc1) 
            {
                this._shortcuts.resetPos(false);
                loc3.y = loc2 + 10 - 8;
                this._navbar.x = (loc1 - GameUI.ChatWidth - GameUI.NavWidth) / 2 + GameUI.ChatWidth;
                UiHintIconView.instance.x = this._navbar.x + 312;
                UiHintIconView.instance.y = Global.stage.stageHeight - 110;
                UiActiveHintIconView.instance.x = this._navbar.x + 312;
                UiActiveHintIconView.instance.y = Global.stage.stageHeight - 180;
            }
            else 
            {
                this._shortcuts.resetPos(true);
                loc3.y = loc2 - 40 - 8;
                this._navbar.x = (loc1 - GameUI.NavWidth) / 2;
                UiHintIconView.instance.x = this._navbar.x + 312;
                UiHintIconView.instance.y = Global.stage.stageHeight - 150;
                UiActiveHintIconView.instance.x = this._navbar.x + 312;
                UiActiveHintIconView.instance.y = Global.stage.stageHeight - 220;
            }
            this._navbar.y = loc2;
            this._nvPosX = this._navbar.x;
            this._nvPosY = this._navbar.y;
            this._shortcuts.x = this._navbar.x + 85;
            this._shortcuts.y = this._navbar.y - 47;
            this._shrinkBtnDown.x = this._shortcuts.x + 868;
            this._shrinkBtnDown.y = this._shortcuts.y + 11;
            Dispatcher.dispatchEvent(new DataEvent(EventName.GameUINavBarResize, new Object /* flash.geom.Point */(this._navbar.x, this._navbar.y)));
            if (this._meidaCardBtn) 
            {
                this._meidaCardBtn.x = this._navbar.x + 922;
                this._meidaCardBtn.y = this._navbar.y - 63;
                this._mediaCardY = this._navbar.y - 63;
            }
            var loc4;
            (loc4 = GameController.chat.hintIconView as Object /* flash.display.DisplayObject */).x = this._navbar.x + 420;
            loc4.y = this._navbar.y - 135;
            if (this._turnedHintIcon && this._turnedHintIcon.stage) 
            {
                this._turnedHintIcon.resize();
            }
            this._msgTipBtn.y = this._navbar.y - 77;
            LayerManager.rightTopUILayer.resetPosition();
            if (this._levelAward && !this._isLevelAwardMove) 
            {
                this._levelAward.x = this._smallMap.x - 280;
                this._levelAward.y = 150;
            }
            if (this._skillLevelGet && !this._skillLevelGet.isHide && !this._skillLevelGet.isMove) 
            {
                this._skillLevelGet.stageResize(this._smallMap.x - 280, 150);
            }
            UiFlyDispalyObjectUtil.instance.resetPoints();
            if (GameController.fish.isHaveShowRoastFish) 
            {
                RoashProgressBar.instance.x = (Global.stage.stageWidth - RoashProgressBar.instance.width) / 2;
                RoashProgressBar.instance.y = this._navbar.y - 230;
            }
            if (this._favoriteView) 
            {
                this._favoriteView.x = Global.stage.stageWidth - this._favoriteView.width - 10;
                this._favoriteView.y = this._smallMap.y + 450;
            }
            if (this._questionBtn) 
            {
                this._questionBtn.x = this._navbar.x + 480;
                this._questionBtn.y = this._navbar.y - 90;
            }
            GameController.firework.fireworkBrightView.x = this._navbar.x + 587;
            GameController.firework.fireworkBrightView.y = this._navbar.y - 182;
            if (GameController.romanic.isHaveRomanicView()) 
            {
                GameController.romanic.romanicView.x = this._navbar.x + 587;
                GameController.romanic.romanicView.y = this._navbar.y - 182;
            }
            if (GameController.romanic.isHaveCellHappyView()) 
            {
                GameController.romanic.cellHappyView.x = this._navbar.x + 597;
                GameController.romanic.cellHappyView.y = this._navbar.y - 182;
            }
            if (GameController.romanic.isHaveCakeMakeView()) 
            {
                GameController.romanic.cakeMakeView.x = this._navbar.x + 597;
                GameController.romanic.cakeMakeView.y = this._navbar.y - 245;
            }
            if (GameController.romanic.isHaveMagpieBridgeView()) 
            {
                GameController.romanic.magpieBridgeView.x = this._navbar.x + 682;
                GameController.romanic.magpieBridgeView.y = this._navbar.y - 180;
            }
            if (SpecialSkillPanel.hasInstance()) 
            {
                SpecialSkillPanel.instance.x = this._nvPosX + 160;
                SpecialSkillPanel.instance.y = this._nvPosY - 65;
            }
            if (GameController.fishActive.isInitView()) 
            {
                (GameController.fishActive.view as Object /* flash.display.DisplayObject */).x = this._navbar.x + 587;
                (GameController.fishActive.view as Object /* flash.display.DisplayObject */).y = this._navbar.y - 182;
            }
            this._navSprite.x = this._navbar.x + 570;
            this._navSprite.y = this._navbar.y - 120;
            if (GameController.coinCopy.isInitView()) 
            {
                (GameController.coinCopy.view as ILayOut).resetPosition();
            }
            if (GameController.battle.isInitView()) 
            {
                (GameController.battle.view as ILayOut).resetPosition();
            }
            if (GameController.peaceField.isInitView()) 
            {
                GameController.peaceField.resetPosition();
            }
            GameController.player.equipmentRepair.resetPosition();
            if (GuideArrowManager.guideArrow.parent == this) 
            {
                GuideArrowManager.stageResize();
            }
            if (GuideTipsManager.guideTips.parent == this) 
            {
                GuideTipsManager.stageResize();
            }
            if (GameController.guildFlameController.isInitCountView()) 
            {
                GameController.guildFlameController.guildCountView.resetPosition();
            }
            return;
        }

        /* internal  */replacePetMenuPanel(): void
        {
            if (this._petMenuPanel) 
            {
                this._petMenuPanel.x = this._navbar.x + this._petBtn.x - 12;
                this._petMenuPanel.y = this._navbar.y + this._petBtn.y - this._petMenuPanel.bgHeight + 7;
            }
            return;
        }

        /* internal  */setObjPosition(arg1: Object /* flash.display.DisplayObject */, arg2: int=1, arg3: int=2, arg4: number=0, arg5: number=0): void
        {
            if (!arg1) 
            {
                return;
            }
            if (arg2 == 1) 
            {
                arg1.y = 10 + arg5;
            }
            if (arg3 == 2) 
            {
                arg1.x = Global.stage.stageWidth - 355 + arg4;
            }
            return;
        }

        /* internal  */onPetBtnMouseOverHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            LaterUtil.addCallLater(LaterUtil.PetBtnOver, this.onPetBtnOver, 0.3);
            return;
        }

        /* internal  */onPetBtnOver(): void
        {
            this.replacePetMenuPanel();
            this._petMenuPanel.show(true);
            if (this._petMenuPanel.parent == null) 
            {
                LayerManager.highestLayer.addChild(this._petMenuPanel);
            }
            return;
        }

        /* internal  */onPetBtnMouseOutHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            LaterUtil.stopCallLater(LaterUtil.PetBtnOver);
            if (this._petMenuPanel.isGuideTips) 
            {
                return;
            }
            this._petMenuPanel.show(false);
            DisplayUtil.removeMe(this._petMenuPanel);
            return;
        }

        /* internal  */updateNavShortcutKey(arg1: Array<any>): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=null;
            var loc6=null;
            var loc5=0;
            while (loc5 < arg1.length) 
            {
                loc1 = arg1[loc5];
                if (ObjectUtils.isString(loc1.key)) 
                {
                    loc2 = loc1.key as string;
                    if (loc3 = this._navbar.getChildByName(loc2) as Object /* flash.display.SimpleButton */) 
                    {
                        loc6 = "";
                        if (loc1.keyData) 
                        {
                            loc4 = loc1.keyData.shortcutsName;
                            loc6 = HTMLUtil.addColor(loc1.keyMapName, "#FFFFFF");
                            if (loc4 != "") 
                            {
                                loc6 = loc6 + HTMLUtil.addColor("(" + loc1.keyData.shortcutsName + ")", "#00FF00");
                            }
                        }
                        else 
                        {
                            loc6 = null;
                        }
                        ToolTipsManager.register(loc3, null, loc6);
                    }
                }
                ++loc5;
            }
            return;
        }

        public showOrHideShortcut(arg1: Boolean): void
        {
            this._shortcuts.visible = arg1;
            return;
        }

        public updateAllShortcutKey(arg1: Array<any>): void
        {
            if (this._shortcuts) 
            {
                this._shortcuts.updateShortcutKey(arg1);
            }
            this.updateNavShortcutKey(arg1);
            if (this._navSprite) 
            {
                this._navSprite.updateShortcutKey(arg1);
            }
            if (this._smallMap) 
            {
                this._smallMap.updateShortcutKey(arg1);
            }
            if (this._petAvatar) 
            {
                this._petAvatar.updateShortcutKey();
            }
            return;
        }

        public get navBarX(): number
        {
            if (this._navbar) 
            {
                return this._navbar.x;
            }
            return 0;
        }

        public get navBarY(): number
        {
            if (this._navbar) 
            {
                return this._navbar.y;
            }
            return 0;
        }

        public showVipHelpBtn(): void
        {
            if (Global.isDebugModle) 
            {
                if (this._vipHelpBtn == null) 
                {
                    this._vipHelpBtn = new GuibintongdaoHintBtn();
                }
                this._vipHelpBtn.show();
            }
            else 
            {
                this.recharge = Cache.instance.role.recharge;
                this.vipHelpUrl = ParamsConst.instance.vipHelpUrl;
                if (this.recharge >= ParamsConst.instance.vipHelpNeedGold && this.vipHelpUrl) 
                {
                    if (this._vipHelpBtn == null) 
                    {
                        this._vipHelpBtn = new GuibintongdaoHintBtn();
                    }
                    this._vipHelpBtn.show();
                }
            }
            return;
        }

        public updateByLevelSealInfo(arg1: LevelSealInfo): void
        {
            this._expbar.updateByLevelSealInfo(arg1);
            return;
        }

        public showJuMenu(): void
        {
            if (this._petMenuPanel) 
            {
                this._petMenuPanel.showJuBtn();
            }
            return;
        }

        public get navbarSprite(): Object /* flash.display.DisplayObjectContainer */
        {
            return this._navSprite;
        }

        public get nvPosX(): int
        {
            return this._nvPosX;
        }

        public get navSprite(): NavSprite
        {
            return this._navSprite;
        }

        public get smallMap(): SmallMap
        {
            return this._smallMap;
        }

        public get teamAvatarSprite(): TeamAvatarSprite
        {
            if (this._teamAvatarSprite == null) 
            {
                this._teamAvatarSprite = new TeamAvatarSprite();
                this._teamAvatarSprite.y = 130;
                this.addChild(this._teamAvatarSprite);
            }
            return this._teamAvatarSprite;
        }

        public get nvPosY(): int
        {
            return this._nvPosY;
        }

        /* internal  */init(): void
        {
            this._navSprite = new NavSprite(Cache.instance.mainUINavbar.isUIByLevel);
            this._navSprite.x = 897;
            this._navSprite.y = 460;
            addChild(this._navSprite);
            mouseEnabled = false;
            this.initNavbar();
            this._smallMap = new SmallMap();
            this._smallMap.x = 1000;
            this.addChild(this._smallMap);
            if (ParamsConst.instance.proxyType == ProxyType.TW) 
            {
                this._meidaCardBtn = ObjCreate.createGLoadedButton(ResFileConst.MeidaCardBtn, 0, 0, 23, 23, this);
                this._meidaCardBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onMediaCardBtnClick);
            }
            this.addAvatar(1, null);
            this.addExpBar();
            MsgManager.addTipStage(this);
            MsgManager.addSpeakerStage(LayerManager.uiLayer);
            this._msgTipBtn = new MsgTipsBtn();
            this._msgTipBtn.x = 1000 - this._msgTipBtn.width;
            this._msgTipBtn.y = this._navbar.y - 77;
            LayerManager.topLayer.addPopUp(this._msgTipBtn);
            this.regBtnToolTip();
            UiHintIconView.instance.x = this._navbar.x + 312;
            UiHintIconView.instance.y = Global.stage.stageHeight - 110;
            UiActiveHintIconView.instance.x = this._navbar.x + 312;
            UiActiveHintIconView.instance.y = Global.stage.stageHeight - 180;
            this.onVipTestCardRes();
            this.resetNavbar();
            this._petDrugBagSprite = new PetDrugBagSprite();
            this._petDrugBagSprite.x = 366;
            this._petDrugBagSprite.y = 85;
            this._petDrugBagSprite.visible = false;
            this.addChild(this._petDrugBagSprite);
            this._shrinkBtnUp = ObjCreate.createGButton("", -175, 2, 27, 22, this._smallMap, "TriUpBtn");
            this._shrinkBtnDown = ObjCreate.createGButton("", 1000, 500, 27, 22, this, "TriDownBtn");
            if (Cache.instance.role.entityInfo.level > 36) 
            {
                this._shrinkBtnUp.visible = true;
                this._shrinkBtnUp.toolTipData = HTMLUtil.addColor(Language.getString(90296), "#ffffff");
                this._shrinkBtnDown.visible = true;
                this._shrinkBtnDown.toolTipData = HTMLUtil.addColor(Language.getString(90294), "#ffffff");
            }
            else 
            {
                this._shrinkBtnUp.visible = false;
                this._shrinkBtnDown.visible = false;
            }
            this._shrinkBtnUp.addEventListener(flash.events.MouseEvent.CLICK, this.onBtnClickHandler);
            this._shrinkBtnDown.addEventListener(flash.events.MouseEvent.CLICK, this.onBtnClickHandler);
            return;
        }

        /* internal  */initNavbar(): void
        {
            this._navbar = GlobalClass.getInstance("Navbar") as Object /* flash.display.MovieClip */;
            this._navbar.mouseEnabled = false;
            this._navbar.x = 277;
            this._navbar.y = 580;
            this.addChild(this._navbar);
            this.resetGuild_Society(Cache.instance.country.isOpenCountry);
            return;
        }

        public resetGuild_Society(arg1: Boolean=false): void
        {
            var loc2=null;
            var loc3=null;
            if (this._navbar == null) 
            {
                return;
            }
            var loc1=this._navbar.getChildByName("guild");
            loc2 = GlobalClass.getInstance("NavbarGuild") as Object /* flash.display.DisplayObject */;
            DisplayUtil.removeMe(loc1);
            DisplayUtil.removeMe(loc2);
            loc2.name = "guild";
            loc2.x = loc1.x;
            loc2.y = loc1.y;
            if (arg1) 
            {
                this._navbar.addChild(loc2);
                loc3 = loc2;
            }
            else 
            {
                this._navbar.addChild(loc1);
                loc3 = loc1;
            }
            loc3.removeEventListener(flash.events.MouseEvent.MOUSE_OVER, this.onBtnMouseOver);
            loc3.removeEventListener(flash.events.MouseEvent.MOUSE_OUT, this.onBtnMouseOut);
            loc3.addEventListener(flash.events.MouseEvent.MOUSE_OVER, this.onBtnMouseOver);
            loc3.addEventListener(flash.events.MouseEvent.MOUSE_OUT, this.onBtnMouseOut);
            return;
        }

        public showShrinkBtn(): void
        {
            this._shrinkBtnUp.visible = true;
            this._shrinkBtnDown.visible = true;
            this.changeShrinkBtnToolTips();
            return;
        }

        public changeShrinkBtnToolTips(): void
        {
            if (this._shrinkBtnUp.styleName != "TriUpBtn") 
            {
                if (this._shrinkBtnUp.styleName == "TriDownBtn") 
                {
                    this._shrinkBtnUp.toolTipData = HTMLUtil.addColor(Language.getString(90297), "#ffffff");
                }
            }
            else 
            {
                this._shrinkBtnUp.toolTipData = HTMLUtil.addColor(Language.getString(90296), "#ffffff");
            }
            if (this._shrinkBtnDown.styleName != "TriUpBtn") 
            {
                if (this._shrinkBtnDown.styleName == "TriDownBtn") 
                {
                    this._shrinkBtnDown.toolTipData = HTMLUtil.addColor(Language.getString(90294), "#ffffff");
                }
            }
            else 
            {
                this._shrinkBtnDown.toolTipData = HTMLUtil.addColor(Language.getString(90295), "#ffffff");
            }
            return;
        }

        public showAllUI(arg1: Boolean): void
        {
            if (arg1) 
            {
                this.showUpUI();
                this.showDownUI();
            }
            else 
            {
                this.hideUpUI();
                this.hideDownUI();
            }
            return;
        }

        /* internal  */clickShrinkBtnUp(): void
        {
            if (LayerManager.rightTopUILayer.isTween) 
            {
                this.showUpUI();
            }
            else 
            {
                this.hideUpUI();
            }
            return;
        }

        /* internal  */showUpUI(): void
        {
            var loc1=0;
            var loc2=70;
            this._shrinkBtnUp.styleName = "TriUpBtn";
            this._shrinkBtnUp.mouseEnabled = false;
            LayerManager.rightTopUILayer.show();
            loc1 = 10;
            LayerManager.rightTopUILayer.isTween = false;
            TweenMax.to(LayerManager.rightTopUILayer, 0.3, {"y": loc1, "ease": Quint.easeIn, "onComplete": this.onHideEnd, "onCompleteParams":[this._shrinkBtnUp]});
            return;
        }

        /* internal  */hideUpUI(): void
        {
            var loc1=0;
            this._shrinkBtnUp.styleName = "TriDownBtn";
            this._shrinkBtnUp.mouseEnabled = false;
            loc1 = -LayerManager.rightTopUILayer.height - 10;
            LayerManager.rightTopUILayer.isTween = true;
            TweenMax.to(LayerManager.rightTopUILayer, 0.3, {"y": loc1, "ease": Quint.easeOut, "onComplete": this.onHideEnd, "onCompleteParams":[this._shrinkBtnUp, LayerManager.rightTopUILayer]});
            return;
        }

        /* internal  */clickShrinkBtnDown(): void
        {
            if (this._isNavbarTween) 
            {
                this.hideDownUI();
            }
            else 
            {
                this.showDownUI();
            }
            return;
        }

        /* internal  */hideDownUI(): void
        {
            var loc1=0;
            this._shrinkBtnDown.mouseEnabled = false;
            loc1 = this._nvPosY + 100;
            this._isNavbarTween = false;
            var loc2=LayerManager.highestLayer;
            DisplayUtil.removeMe(this._petMenuPanel);
            GuideArrowManager.hideGuideArrow();
            TweenMax.to(this._navbar, 0.6, {"y": loc1, "ease": loc1});
            if (this._meidaCardBtn) 
            {
                TweenMax.to(this._meidaCardBtn, 0.6, {"y": _mediaCardY + 100});
            }
            TweenMax.to(this._navSprite, 0.6, {"y": _nvPosY - 120 + 130, "ease": Quint.easeOut, "onComplete": this.onHideTarget, "onCompleteParams":[this._navSprite, this._navbar, this._shrinkBtnDown]});
            this._shrinkBtnDown.styleName = "TriUpBtn";
            return;
        }

        /* internal  */showDownUI(): void
        {
            this._shrinkBtnDown.mouseEnabled = false;
            this._isNavbarTween = true;
            this._navbar.visible = true;
            this._navSprite.visible = true;
            TweenMax.to(this._navbar, 0.3, {"y": _nvPosY, "ease": Quint.easeIn});
            TweenMax.to(this._navSprite, 0.3, {"y": _nvPosY - 120, "ease": Quint.easeIn, "onComplete": this.onShrinkBtnMouseEnable, "onCompleteParams":[this._shrinkBtnDown]});
            this._shrinkBtnDown.styleName = "TriDownBtn";
            if (this._meidaCardBtn) 
            {
                this._meidaCardBtn.visible = true;
                TweenMax.to(this._meidaCardBtn, 0.3, {"y": _mediaCardY, "ease": Quint.easeIn});
            }
            return;
        }

        protected onBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=0;
            if (arg1.target != this._shrinkBtnUp) 
            {
                this.clickShrinkBtnDown();
            }
            else 
            {
                this.clickShrinkBtnUp();
            }
            return;
        }

        /* internal  */onShrinkBtnMouseEnable(arg1: GButton): void
        {
            this._shrinkBtnDown.mouseEnabled = true;
            this.changeShrinkBtnToolTips();
            return;
        }

        /* internal  */onHideTarget(arg1: Object /* flash.display.DisplayObject */, arg2: Object /* flash.display.DisplayObject */, arg3: GButton=null): void
        {
            arg1.visible = false;
            arg2.visible = false;
            if (arg3) 
            {
                arg3.mouseEnabled = true;
                this.changeShrinkBtnToolTips();
            }
            return;
        }

        /* internal  */onHideEnd(arg1: GButton, arg2: Object /* flash.display.DisplayObject */=null): void
        {
            arg1.mouseEnabled = true;
            this.changeShrinkBtnToolTips();
            if (arg2 && arg2.parent) 
            {
                arg2.parent.removeChild(arg2);
            }
            return;
        }

        /* internal  */onMediaCardBtnClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            MeidaCardWindow.instace.show();
            return;
        }

        /* internal  */onMarketBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (GameController.market.view.isHide) 
            {
                GameController.market.view.show();
            }
            else 
            {
                GameController.market.view.hide();
            }
            return;
        }

        public resetNavbar(): void
        {
            var loc5=null;
            var loc7=0;
            var loc1=[{"name": Players, "value": Language.getString(51004)}, {"name": Pack, "value": Language.getString(51005)}, {"name": Pets, "value": Language.getString(51006)}, {"name": Mounts, "value":""}, {"name": Guild, "value": Language.getString(51008)}, {"name": Daily, "value": Language.getString(51009)}, {"name": Skills, "value": Language.getString(51010)}, {"name": ExploreShop, "value": Language.getString(51011)}, {"name": Fairyland, "value": Language.getString(51011)}];
            var loc2=46.5;
            GameUI._isHideFairyland = Cache.instance.role.isHideFairyland;
            GameUI._isHideExploreShop = Cache.instance.role.getisHideExploreShop;
            var loc3=this._navbar.getChildByName(ModuleType.Fairyland) as Object /* flash.display.SimpleButton */;
            var loc4=this._navbar.getChildByName(ModuleType.ExploreShop) as Object /* flash.display.SimpleButton */;
            if (!Cache.instance.mainUINavbar.isUIByLevel) 
            {
                loc7 = -1;
                if (loc3) 
                {
                    loc3.visible = !GameUI._isHideFairyland;
                }
                if (loc4) 
                {
                    loc4.visible = !GameUI._isHideExploreShop;
                }
                if (GameUI._isHideFairyland) 
                {
                    loc7 = loc1.indexOf(loc3);
                    loc1.splice(loc7, 1);
                }
                if (GameUI._isHideExploreShop) 
                {
                    loc7 = loc1.indexOf(loc4);
                    loc1.splice(loc7, 1);
                }
                if (GameUI._isHideFairyland && GameUI._isHideExploreShop) 
                {
                    loc2 = 55;
                    loc1.pop();
                }
            }
            var loc6=0;
            while (loc6 < loc1.length) 
            {
                loc5 = loc1[loc6];
                loc3 = this._navbar.getChildByName(loc5.name) as Object /* flash.display.SimpleButton */;
                if (loc3) 
                {
                    loc3.x = 480 + loc6 * loc2;
                }
                ++loc6;
            }
            return;
        }

        public getFairylandBtn(): Object /* flash.display.SimpleButton */
        {
            return this._navbar.getChildByName("exploreShop") as Object /* flash.display.SimpleButton */;
        }

        public getPlayersBtn(): Object /* flash.display.SimpleButton */
        {
            return this._navbar.getChildByName("players") as Object /* flash.display.SimpleButton */;
        }

        
        {
            GameUI._isFirstAdd = true;
        }

        public addTurnedHintIcon(): void
        {
            if (this._turnedHintIcon == null) 
            {
                this._turnedHintIcon = new TurnedHintIcon();
                this._turnedHintIcon.layer = this;
            }
            this._turnedHintIcon.resize();
            this._turnedHintIcon.show(this.x, this.y);
            return;
        }

        public removeTurnedHintIcon(): void
        {
            if (this._turnedHintIcon) 
            {
                this._turnedHintIcon.hide();
            }
            return;
        }

        public updateHintIcon(arg1: number): void
        {
            if (this._turnedHintIcon) 
            {
                this._turnedHintIcon.updateLeftTime(arg1);
            }
            return;
        }

        public showWalkthroughIcon(): void
        {
            WalkthroughIcon.instance.show();
            return;
        }

        public showPetMenu(): void
        {
            if (this._petBtn == null) 
            {
                this._petBtn = this._navbar.getChildByName(ModuleType.Pets) as Object /* flash.display.SimpleButton */;
                this._petBtn.addEventListener(flash.events.MouseEvent.MOUSE_OVER, this.onPetBtnMouseOverHandler);
                this._petBtn.addEventListener(flash.events.MouseEvent.MOUSE_OUT, this.onPetBtnMouseOutHandler);
            }
            if (this._petMenuPanel == null) 
            {
                this._petMenuPanel = new PetMenuPanel(LayerManager.highestLayer);
                this.resize(Global.stage.stageWidth, Global.stage.stageHeight);
            }
            this.replacePetMenuPanel();
            return;
        }

        public energyComplete(): void
        {
            if (this._xpTipPanel == null) 
            {
                this._xpTipPanel = new XpSkillTipPanel();
            }
            var loc1=(Global.stage.stageWidth - this._xpTipPanel.width) / 2;
            if (!this.contains(this._xpTipPanel)) 
            {
                this._xpTipPanel.x = loc1;
                this._xpTipPanel.y = Global.stage.stageHeight;
                this.addChild(this._xpTipPanel);
            }
            this._xpTipPanel.startTimer();
            var loc2=(Global.stage.stageHeight - this._xpTipPanel.height) / 2 + 100;
            TweenMax.to(this._xpTipPanel, 1, {"x": loc1, "y": loc2});
            return;
        }

        public highlightWalkthroughIcon(arg1: Boolean=true): void
        {
            WalkthroughIcon.instance.flashIcon(arg1);
            return;
        }

        public addAvatar(arg1: int, arg2: SEntityInfo): void
        {
            var loc1=arg1;
            switch (loc1) 
            {
                case 1:
                {
                    arg2 = Cache.instance.role.entityInfo;
                    this._roleAvatar = new RoleAvatar(arg2);
                    this._roleAvatar.x = 0;
                    this._roleAvatar.y = 0;
                    this.addChild(this._roleAvatar);
                    break;
                }
                case 2:
                {
                    if (this._petAvatar != null) 
                    {
                        this._petAvatar.updateAvatarUI(arg2);
                        if (!(this._petAvatar.petInfo.status == EPetStatus._EPetEquip) && !(this._petAvatar.petInfo.status == EPetStatus._EpetTrain)) 
                        {
                            this._petAvatar.showCBtn(false);
                        }
                    }
                    else 
                    {
                        this._petAvatar = new PetAvatar(arg2);
                        this._petAvatar.x = 216;
                        this._petAvatar.y = 80;
                        this._petDrugBagSprite.visible = true;
                        this.addChild(this._petAvatar);
                        if (this._teamAvatarSprite) 
                        {
                            this.swapChildren(this._teamAvatarSprite, this._petAvatar);
                        }
                    }
                    if (arg2) 
                    {
                        this._petdragItemInfo.level = arg2.level;
                        this._petdragItemInfo.maxLife = arg2.maxLife;
                        this._petdragItemInfo.reinLevel = arg2.reinLevel;
                        this._petDrugBagSprite.petDrugItemInfo = this._petdragItemInfo;
                    }
                    if (this.contains(this._petAvatar) == false) 
                    {
                        this._petDrugBagSprite.visible = true;
                        this.addChild(this._petAvatar);
                    }
                    break;
                }
            }
            return;
        }

        public updateAimAvatar(arg1: EntityInfo): void
        {
            if (this._aimAvatar != null) 
            {
                this._aimAvatar.updateAimAvatarUI(arg1);
            }
            else 
            {
                this._aimAvatar = new AimAvatar(arg1);
                this._aimAvatar.x = 427;
                this._aimAvatar.y = 0;
            }
            if (this.contains(this._aimAvatar) == false) 
            {
                this.addChild(this._aimAvatar);
            }
            return;
        }

        public updateMonsterAvatar(arg1: SEntityInfo): void
        {
            if (this._monsterAvatar == null) 
            {
                this._monsterAvatar = new MonsterAvatar();
                this._monsterAvatar.x = 427;
                this._monsterAvatar.y = 0;
            }
            this._monsterAvatar.updateAvatarUI(arg1);
            if (this.contains(this._monsterAvatar) == false) 
            {
                this.addChild(this._monsterAvatar);
            }
            return;
        }

        public updateNpcAvatar(arg1: SEntityInfo): void
        {
            if (this._npcAvatar != null) 
            {
                this._npcAvatar.updateAvatarUI(arg1);
            }
            else 
            {
                this._npcAvatar = new NPCAvatar(arg1);
                this._npcAvatar.x = 427;
                this._npcAvatar.y = 0;
                this.addChild(this._npcAvatar);
            }
            if (this.contains(this._npcAvatar) == false) 
            {
                this.addChild(this._npcAvatar);
            }
            return;
        }

        public removeAvatar(arg1: int): void
        {
            var loc1=arg1;
            switch (loc1) 
            {
                case 2:
                {
                    if (this._petAvatar && this.contains(this._petAvatar)) 
                    {
                        this._petDrugBagSprite.visible = false;
                        this.removeChild(this._petAvatar);
                    }
                    break;
                }
                case 3:
                {
                    if (this._aimAvatar && this.contains(this._aimAvatar)) 
                    {
                        this.removeChild(this._aimAvatar);
                    }
                    break;
                }
                case 4:
                {
                    if (this._npcAvatar && this.contains(this._npcAvatar)) 
                    {
                        this.removeChild(this._npcAvatar);
                    }
                    break;
                }
                case 5:
                {
                    if (this._monsterAvatar && this.contains(this._monsterAvatar)) 
                    {
                        this.removeChild(this._monsterAvatar);
                    }
                    break;
                }
            }
            return;
        }

        public dealPetBagUpdate(): void
        {
            var loc2=null;
            var loc3=null;
            var loc4=null;
            var loc1=Cache.instance.pet.petUpdate;
            if (this._petAvatar && this.contains(this._petAvatar) && loc1) 
            {
                loc2 = loc1.petInfo;
                if (this._petAvatar.petInfo && loc1.uid == this._petAvatar.petInfo.uid) 
                {
                    this._petAvatar.petInfo = loc2;
                    this._petdragItemInfo.level = loc2.level;
                    this._petdragItemInfo.maxLife = loc2.fightAttribute.maxLife;
                    this._petdragItemInfo.reinLevel = loc2.reinLevel;
                    this._petDrugBagSprite.petDrugItemInfo = this._petdragItemInfo;
                    this._petAvatar.updateEnergy(int(loc2.energy / 3), int(loc2.maxEnergy / 3));
                }
                if (this._petAvatar.petInfo && loc1.uid == this._petAvatar.petInfo.uid) 
                {
                    if (loc1.updateType != 2) 
                    {
                        if (loc1.updateType == 4) 
                        {
                            loc3 = this._petAvatar.selfSEntityInfo;
                            loc4 = loc3.buffers;
                            loc3.name = loc2.name;
                            loc3.level = loc2.level;
                            loc3.life = loc2.life;
                            loc3.maxLife = loc2.fightAttribute.maxLife;
                            loc3.mana = loc2.mana;
                            loc3.maxMana = loc2.fightAttribute.maxMana;
                            loc3.buffers = this._petAvatar.petInfo.status != EPetStatus._EPetRest ? loc4 : [];
                            this.addAvatar(2, loc3);
                            if (this._petAvatar.petInfo.status != EPetStatus._EPetSire) 
                            {
                                if (this._petAvatar.petInfo.status == EPetStatus._EPetEquip || this._petAvatar.petInfo.status == EPetStatus._EPetRest || this._petAvatar.petInfo.status == EPetStatus._EpetTrain) 
                                {
                                    this._petAvatar.showCBtn(true);
                                }
                                else 
                                {
                                    this._petAvatar.showCBtn(false);
                                }
                            }
                            else 
                            {
                                this.removeAvatar(2);
                            }
                            Dispatcher.dispatchEvent(new DataEvent(EventName.PetAutoResume, loc3));
                        }
                    }
                    else 
                    {
                        this.removeAvatar(2);
                    }
                }
            }
            return;
        }

        public showCBtn(arg1: Boolean=true): void
        {
            if (this._petAvatar) 
            {
                this._petAvatar.showCBtn(arg1);
            }
            return;
        }

        public updateExp(arg1: number, arg2: number): void
        {
            this._expbar.setValue(arg1, arg2);
            return;
        }

        public addExpBar(): void
        {
            this._expbar = new ExpBar();
            this._expbar.x = 115;
            this._expbar.y = -10;
            this._navbar.addChild(this._expbar);
            return;
        }

        public updateAvatar(arg1: SEntityInfo): void
        {
            this._roleAvatar.updateAvatarUI(arg1);
            return;
        }

        public updateBuffer(arg1: Array<any>): void
        {
            var loc1=null;
            this._roleAvatar.updateBufferByBuffInfoArray(arg1);
            var loc2=[];
            var loc3=0;
            while (loc3 < arg1.length) 
            {
                loc1 = ObjectUtils.baseClone(SkillStateConfig.instance.getInfoByName(arg1[loc3].stateId)) as TState;
                if (loc1 && !(loc1.icon == "")) 
                {
                    loc2.push(loc1);
                }
                ++loc3;
            }
            if (loc2.length > 5) 
            {
                this._roleAvatar.minBtn.visible = true;
                if (this._roleAvatar.minBtn.styleName != "MinMinusBtn") 
                {
                    this._roleAvatar.hideBuffAfterFine();
                }
                else 
                {
                    this._roleAvatar.showBuffAfterFine();
                }
            }
            else 
            {
                this._roleAvatar.minBtn.visible = false;
                this._roleAvatar.hideBuffAfterFine();
            }
            return;
        }

        public updateLockStatus(): void
        {
            this._roleAvatar.updateLockStatus();
            return;
        }

        public updateShortcuts(arg1: Map<any, any> /* flash.utils.Dictionary */): void
        {
            this._shortcuts.updateShortcuts(arg1);
            return;
        }

        public setPoint(arg1: AStarPoint): void
        {
            if (arg1) 
            {
                this._smallMap.updatePoint(arg1);
            }
            return;
        }

        public updateSmallMapPath(arg1: Array<any>): void
        {
            this._smallMap.updateSmallMapPath(arg1);
            return;
        }

        public updateMiniMap(): void
        {
            this._smallMap.updateMiniMap();
            return;
        }

        public conveyRes(): void
        {
            this._smallMap.clearLine();
            this._smallMap.updatePoint(RolePlayer.instance.currentPoint);
            return;
        }

        public setMailNotice(arg1: Boolean): void
        {
            if (arg1) 
            {
                this._smallMap.showMailMask(true);
            }
            else 
            {
                this._smallMap.showMailMask(false);
            }
            return;
        }

        public setTWNotVisitAll(): void
        {
            this._smallMap.showTWHuiMask(true);
            return;
        }

        public updateMapName(arg1: string): void
        {
            this._smallMap.updateMapName(arg1);
            return;
        }

        public updateDailyAward(arg1: Object): void
        {
            if (this._dailyAward == null) 
            {
                this._dailyAward = new DailyAwardPanel();
                this._dailyAward.show();
            }
            this._dailyAward.setAwardInfo(arg1);
            return;
        }

        public updateLevelAward(arg1: Object): void
        {
            if (this._levelAward == null) 
            {
                this._levelAward = new LevelAwardPanel();
                this._levelAward.x = this._smallMap.x - 280;
                this._levelAward.y = 150;
                addChild(this._levelAward);
            }
            this._levelAward.setAwardInfo(arg1);
            return;
        }

        public flyLevelAward(): void
        {
            var loc1=null;
            if (this._levelAward && !this._isLevelAwardMove) 
            {
                this._isLevelAwardMove = true;
                loc1 = UiFlyDispalyObjectUtil.instance.getPoint(this._levelAward);
                TweenLite.to(this._levelAward, 3, {"x": loc1.x, "y": loc1.y, "delay": 2, "onComplete": this.levelAwardFlyEnd});
            }
            return;
        }

        /* internal  */levelAwardFlyEnd(): void
        {
            UiFlyDispalyObjectUtil.instance.resetPoints();
            return;
        }

        public addQuestionButton(): void
        {
            if (this._questionBtn != null) 
            {
                addChild(this._questionBtn);
            }
            else 
            {
                this._questionBtn = ObjCreate.createGButton(Language.getString(51014), this._navbar.x + 480, this._navbar.y - 90, 70, 25, this, "Button");
                this._questionBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onQuestionBtnClick);
            }
            return;
        }

        public removeDailyAward(): void
        {
            this._dailyAward.hide();
            this._dailyAward = null;
            return;
        }

        public removeLevelAward(): void
        {
            if (this._levelAward == null) 
            {
                return;
            }
            UiFlyDispalyObjectUtil.instance.reducePoint(this._levelAward);
            this._isLevelAwardMove = false;
            this._levelAward.dispose();
            removeChild(this._levelAward);
            this._levelAward = null;
            return;
        }

        public removeQuestionButton(): void
        {
            if (this._questionBtn && this._questionBtn.parent) 
            {
                removeChild(this._questionBtn);
                this._questionBtn = null;
            }
            return;
        }

        public onVIPLevelUpgrade(arg1: SVIPInfo): void
        {
            if (this._roleAvatar) 
            {
                this._roleAvatar.onVIPLevelUpgrade(arg1);
            }
            return;
        }

        public getNavbarIconGlobalPoint(arg1: string): Object /* flash.geom.Point */
        {
            var loc1=this._navbar.getChildByName(arg1) as Object /* flash.display.DisplayObject */;
            if (loc1 != null) 
            {
                return loc1.localToGlobal(new Object /* flash.geom.Point */(0, 0));
            }
            return new Object /* flash.geom.Point */(0, 0);
        }

        public getBackPackPoint(): Object /* flash.geom.Point */
        {
            var loc1=this._navbar.getChildByName("pack") as Object /* flash.display.SimpleButton */;
            var loc2=new Object /* flash.geom.Point */(this._navbar.x + loc1.x, this._navbar.y + loc1.y);
            return loc2;
        }

        public getPlayerPoint(): Object /* flash.geom.Point */
        {
            var loc1=this._navbar.getChildByName("players") as Object /* flash.display.SimpleButton */;
            var loc2=new Object /* flash.geom.Point */(this._navbar.x + loc1.x, this._navbar.y + loc1.y);
            return loc2;
        }

        public getPetPoint(): Object /* flash.geom.Point */
        {
            var loc1=this._navbar.getChildByName("pets") as Object /* flash.display.SimpleButton */;
            var loc2=new Object /* flash.geom.Point */(this._navbar.x + loc1.x, this._navbar.y + loc1.y);
            return loc2;
        }

        public setFightModeButton(): void
        {
            this._roleAvatar.setFightModeButton();
            return;
        }

        public petDeath(): void
        {
            if (this._petAvatar) 
            {
                HighlightManager.instance.glowEffectButton(this._petAvatar, true);
                this._petAvatar.showCBtn(true);
            }
            MsgManager.showRollTipsMsg(Language.getString(51015));
            if (Cache.instance.role.entityInfo.level <= 30) 
            {
                HighlightManager.instance.glowEffectButton(this._navbar.getChildByName(ModuleType.Pets) as Object /* flash.display.SimpleButton */, true);
            }
            return;
        }

        public HighlightNavbar(arg1: string, arg2: Boolean=true): void
        {
            HighlightManager.instance.glowEffectButton(this._navbar.getChildByName(arg1) as Object /* flash.display.SimpleButton */, arg2);
            return;
        }

        public removePetAvatarHighlight(): void
        {
            HighlightManager.instance.glowEffectButton(this._petAvatar, false);
            HighlightManager.instance.glowEffectButton(this._navbar.getChildByName(ModuleType.Pets) as Object /* flash.display.SimpleButton */, false);
            return;
        }

        public petRest(): void
        {
            if (Cache.instance.role.entityInfo.level <= 30) 
            {
                HighlightManager.instance.glowEffectButton(this._navbar.getChildByName(ModuleType.Pets) as Object /* flash.display.SimpleButton */, true);
            }
            return;
        }

        public guideOpenModule(arg1: string, arg2: Boolean=false): void
        {
            if (!(this.guideModuleOpenImpl(arg1, ModuleType.AutoFight, this._smallMap, this._smallMap.mapMain, GuideArrowManager.Dir_R, true, false, Cache.instance.guide.fuBenGuide, arg2) || this.guideModuleOpenImpl(arg1, ModuleType.Activity, this, this._navbar, GuideArrowManager.Dir_B, false, true, false, arg2) || this.guideModuleOpenImpl(arg1, ModuleType.Build, this, this._navSprite, GuideArrowManager.Dir_B, false, true, false, arg2) || this.guideModuleOpenImpl(arg1, ModuleType.Pets, this, this._navbar, GuideArrowManager.Dir_B, false, true, false, arg2) || this.guideModuleOpenImpl(arg1, ModuleType.Skills, this, this._navbar, GuideArrowManager.Dir_B, false, true, false, arg2) || this.guideModuleOpenImpl(arg1, ModuleType.Group, null, this._navbar, GuideArrowManager.Dir_B, false, true, false, arg2) || this.guideModuleOpenImpl(arg1, ModuleType.Guild, this, this._navbar, GuideArrowManager.Dir_B, false, true, false, arg2) || this.guideModuleOpenImpl(arg1, ModuleType.AllShow, this._smallMap, this._smallMap.mapMain, GuideArrowManager.Dir_B, true, false, true, arg2) || this.guideModuleOpenImpl(arg1, ModuleType.WuXing, null, this._navSprite, GuideArrowManager.Dir_B, false, false, false, arg2))) 
            {
            };
            return;
        }

        /* internal  */guideModuleOpenImpl(arg1: string, arg2: string, arg3: Object /* flash.display.DisplayObjectContainer */, arg4: Object /* flash.display.DisplayObjectContainer */, arg5: int, arg6: Boolean, arg7: Boolean=false, arg8: Boolean=false, arg9: Boolean=false): Boolean
        {
            var loc1=null;
            var loc2=null;
            if (arg1 == arg2) 
            {
                loc1 = arg4.getChildByName(arg1);
                if (arg8) 
                {
                    if (arg1 == ModuleType.AllShow) 
                    {
                        MsgManager.showGuideTips(Language.getString(20731), arg4.x + loc1.x - 165, arg4.y + loc1.y - 5, arg3, 10000);
                    }
                    flash.utils.setTimeout(this.onGuideTimeOut, 8000, {"module": arg1, "dis": arg4});
                }
                else if (arg3) 
                {
                    loc2 = GuideArrowManager.getGuideArrow(arg5, this.onGuideTimeOut, 20000, {"module": arg1, "dis": arg4});
                    if (arg9) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.MainUIByLevelShowArrow, loc1.name));
                    }
                    else 
                    {
                        if (arg1 != ModuleType.AutoFight) 
                        {
                            loc2.x = arg4.x + loc1.x + loc1.width / 2;
                            loc2.y = arg4.y + loc1.y;
                        }
                        else 
                        {
                            loc2.x = arg4.x + loc1.x - loc1.width / 2;
                            loc2.y = arg4.y + loc1.y + loc1.height / 2;
                        }
                        if (arg7) 
                        {
                            loc2.baseX = loc1.x + loc1.width / 2;
                            loc2.baseY = loc1.y;
                            loc2.baseLayer = arg4;
                        }
                        arg3.addChild(loc2);
                    }
                }
                if (arg6) 
                {
                    HighlightManager.instance.flashMaskButton(loc1, true);
                }
                else 
                {
                    HighlightManager.instance.glowEffectButton(loc1, true);
                }
                return true;
            }
            return false;
        }

        /* internal  */onGuideTimeOut(arg1: Object): void
        {
            HighlightManager.instance.flashMaskButton(arg1.dis.getChildByName(arg1.module), false);
            HighlightManager.instance.glowEffectButton(arg1.dis.getChildByName(arg1.module), false);
            return;
        }

        public guideHideTips(arg1: string): void
        {
            if (!(this.hideGuideArrow(arg1, ModuleType.Pets, this, this._navbar, Cache.instance.guide.petGuide || Cache.instance.guide.petVersionChange) || this.hideGuideArrow(arg1, ModuleType.AutoFight, this._smallMap, this._smallMap.mapMain) || this.hideGuideArrow(arg1, ModuleType.Activity, this, this._navbar) || this.hideGuideArrow(arg1, ModuleType.Skills, this, this._navbar) || this.hideGuideArrow(arg1, ModuleType.Build, this, this._navSprite) || this.hideGuideArrow(arg1, ModuleType.Group, this) || this.hideGuideArrow(arg1, ModuleType.Guild, this, this._navbar) || this.hideGuideArrow(arg1, ModuleType.AllShow, this._smallMap, this._smallMap.mapMain) || this.hideGuideArrow(arg1, ModuleType.WuXing, this, this._navSprite))) 
            {
            };
            return;
        }

        /* internal  */hideGuideArrow(arg1: string, arg2: string, arg3: Object /* flash.display.DisplayObjectContainer */, arg4: Object /* flash.display.DisplayObjectContainer */=null, arg5: Boolean=true): Boolean
        {
            if (arg1 == arg2 && arg5) 
            {
                if (arg3 && GuideArrowManager.guideArrow.parent == arg3) 
                {
                    GuideArrowManager.hideGuideArrow();
                }
                if (arg4) 
                {
                    HighlightManager.instance.glowEffectButton(arg4.getChildByName(arg1), false);
                    HighlightManager.instance.flashMaskButton(arg4.getChildByName(arg1), false);
                }
                return true;
            }
            return false;
        }

        public guidePetFight(): void
        {
            this.showPetMenu();
            this.onPetBtnMouseOverHandler(null);
            this._petMenuPanel.guidePetFight();
            return;
        }

        public guidePetLifeStyle(): void
        {
            this.showPetMenu();
            this.onPetBtnMouseOverHandler(null);
            this._petMenuPanel.guidePetLifeStyle();
            return;
        }

        public onGuidePetEquipRefresh(): void
        {
            this.showPetMenu();
            this.onPetBtnMouseOverHandler(null);
            this._petMenuPanel.onGuidePetEquipRefresh();
            return;
        }

        public onGuidePetEquipStrenthen(): void
        {
            this.showPetMenu();
            this.onPetBtnMouseOverHandler(null);
            this._petMenuPanel.onGuidePetEquipStrenthen();
            return;
        }

        public onGuideFirstPurplePetEquipment(): void
        {
            this._navSprite.onGuideFirstPurplePetEquipment();
            return;
        }

        /* internal */ static /* const */NavWidth: int=1000;

        /* internal */ static /* const */ChatWidth: int=265;

        /* internal */ /* var */_pointText: GLabel;

        /* internal */ /* var */_navSprite: NavSprite;

        /* internal */ /* var */_expbar: ExpBar;

        /* internal */ /* var */_roleAvatar: RoleAvatar;

        /* internal */ /* var */_shortcuts: Shortcuts;

        /* internal */ /* var */_aimAvatar: AimAvatar;

        /* internal */ /* var */_vipCard: VipCard;

        /* internal */ /* var */_petDrugBagSprite: PetDrugBagSprite;

        /* internal */ /* var */_questionBtn: GButton;

        /* internal */ /* var */_monsterAvatar: MonsterAvatar;

        /* internal */ /* var */_xpTipPanel: XpSkillTipPanel;

        /* internal */ /* var */_petBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_petMenuPanel: PetMenuPanel;

        /* internal */ /* var */_meidaCardBtn: GLoadedButton;

        /* internal */ /* var */_shrinkBtnUp: GButton;

        /* internal */ /* var */_shrinkBtnDown: GButton;

        /* internal */ /* var */_isNavbarTween: Boolean=true;

        /* internal */ /* var */_nvPosY: int;

        /* internal */ /* var */_mediaCardY: int;

        /* internal */ /* var */recharge: int;

        /* internal */ /* var */_vipHelpBtn: GuibintongdaoHintBtn;

        public /* var */vipHelpUrl: string;

        /* internal */ /* var */_teamAvatar: Array<any>;

        /* internal */ /* var */_petAvatar: PetAvatar;

        /* internal */ /* var */_msgTipBtn: MsgTipsBtn;

        /* internal */ /* var */_dailyAward: DailyAwardPanel;

        /* internal */ /* var */_levelAward: LevelAwardPanel;

        /* internal */ /* var */_npcAvatar: NPCAvatar;

        /* internal */ /* var */_teamAvatarSprite: TeamAvatarSprite;

        /* internal */ /* var */_teamShowButton: GButton;

        /* internal */ /* var */_favoriteView: FavoriteView;

        /* internal */ /* var */_skillLevelGet: FishIconView;

        /* internal */ /* var */_petdragItemInfo: PetDrugItemInfo;

        /* internal */ /* var */_nvPosX: int;

        /* internal */ /* var */_turnedHintIcon: TurnedHintIcon;

        /* internal */ static /* var */_isFirstAdd: Boolean=true;

        /* internal */ static /* var */_isHideFairyland: Boolean;

        /* internal */ static /* var */_isHideExploreShop: Boolean;

        /* internal */ /* var */_navbar: Object /* flash.display.MovieClip */;

        /* internal */ /* var */_smallMap: SmallMap;

        /* internal */ /* var */_isLevelAwardMove: Boolean=false;
    }
